package com.lzy.mall.search.controller;

import com.lzy.mall.common.to.es.SkuEsModel;
import com.lzy.mall.common.utils.ResultUtils;
import com.lzy.mall.search.service.ProductSaveService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lzy
 * @date 2021/9/7 15:27
 */
@RestController
@RequestMapping("/search/save")
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
public class ElasticSaveController {

    private final ProductSaveService productSaveService;

    //上架商品
    @PostMapping("/product")
    public ResultUtils<?> productStatusUp(@RequestBody List<SkuEsModel> skuEsModels){
        productSaveService.productStatusUp(skuEsModels);
        return ResultUtils.ok();
    }
}
